home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Telnet / NCSA / tn3270 2.3d26 source / tn3270 / bgproc.a < prev    next >
Text File  |  1991-05-26  |  5KB  |  171 lines

  1.         case    yes
  2.         print    sym
  3.         
  4. ;
  5. ;  tn3270 for the Macintosh Source Code
  6. ;  Brown University Computing and Information Services
  7. ;  Version 2.3d21, January 17, 1991
  8. ;  Copyright (c) 1988, 1989, 1990, 1991 by Brown University and 
  9. ;  by Peter John DiCamillo.
  10. ;
  11. ;  Permission is granted to any individual or institution to use, copy,
  12. ;  or redistribute the binary version of this software and its
  13. ;  documentation provided this notice and the copyright notices are
  14. ;  retained.  Permission is granted to any individual or non-profit
  15. ;  institution to use, copy, modify, or redistribute the source files
  16. ;  of this software provided this notice and the copyright notices are
  17. ;  retained.  This software may not be distributed for profit, either
  18. ;  in original form or in derivative works, nor can the source be
  19. ;  distributed to other than an individual or a non-profit institution.
  20. ;  Any  individual or group interested in seeing and/or using these
  21. ;  source files but who are prevented from doing so by the above
  22. ;  constraints should contact Don Wolfe, Assistant Vice-President for
  23. ;  Computer Systems at Brown University, (401) 863-7250, for possible
  24. ;  software licensing of the source developed at Brown.
  25. ;
  26. ;  Brown University and Peter John DiCamillo make no representations
  27. ;  about the suitability of this software for any purpose.
  28. ;
  29. ;  BROWN UNIVERSITY AND PETER JOHN DICAMILLO GIVE NO WARRANTY, EITHER
  30. ;  EXPRESS OR IMPLIED, FOR THE PROGRAM AND/OR DOCUMENTATION PROVIDED,
  31. ;  INCLUDING, WITHOUT LIMITATION, WARRANTY OF MERCHANTABILITY AND
  32. ;  WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.
  33. ;
  34.  
  35.         import    sw_proc
  36.         import    reqproc
  37.         import    sndend
  38.         import    nmend
  39.         export    bgproc
  40.         export    store_a5
  41.         export    reqint
  42.         export    GetA5
  43.         export    sndproc
  44.         export    nmproc
  45.         export    nminstall
  46.         export    nmremove
  47.         export    Gestalt
  48.         export  PPCInit
  49.         export    ppcsync
  50.         export    ppcasync
  51.         export    PPCBROWSER
  52.         
  53. saveregs    reg        a0-a6/d0-d7
  54. CurrentA5    equ      $904             ; current value of A5 [pointer]
  55.  
  56. bgproc    proc
  57.         movem.l    saveregs,-(sp)        ;save registers
  58.         move.l    (a1),a1                ;a1 = pcb handle
  59.         move.l    (a1),a1                ;a1 -> pcb
  60.         move.l    332(a1),a5            ;restore pointer to globals
  61.         jsr        sw_proc                ;call C processing code
  62.         movem.l (sp)+,saveregs        ;restore registers
  63.         rts
  64.         endproc
  65.  
  66. sndproc    proc
  67.         movem.l    saveregs,-(sp)        ;save registers
  68.         move.l    64(sp),a5            ;a5 -> SndCommand
  69.         move.l    4(a5),a5            ;restore pointer to globals
  70.         jsr        sndend                ;call C processing code
  71.         movem.l (sp)+,saveregs        ;restore registers
  72.         move.l    (sp),8(sp)            ;move return address
  73.         add.l    #8,sp                ;remove parameters from stack
  74.         rts                            ;return
  75.         endproc
  76.  
  77. nmproc    proc
  78.         movem.l    saveregs,-(sp)        ;save registers
  79.         move.l    64(sp),a5            ;a5 -> NMrec
  80.         move.l    32(a5),a5            ;restore pointer to globals
  81.         move.l    64(sp),-(sp)        ;push parameter
  82.         jsr        nmend                ;call C processing code
  83.         move.l    (sp)+,a5            ;pop parameter
  84.         movem.l (sp)+,saveregs        ;restore registers
  85.         move.l    (sp),4(sp)            ;move return address
  86.         add.l    #4,sp                ;remove parameter from stack
  87.         rts                            ;return
  88.         endproc
  89.  
  90. store_a5 proc
  91.         move.l    4(sp),a0            ; get address parameter
  92.         add.l    #48,a0                ; point to end of block
  93.         move.l    a5,(a0)                ; store a5 there
  94.         rts
  95.         endproc
  96.  
  97. GetA5    proc
  98.         move.l    a5,d0                ; store old A5 as function result
  99.         rts
  100.         endproc
  101.  
  102. reqint    proc
  103.         movem.l    saveregs,-(sp)        ;save registers
  104.         move.l    48(a0),a5            ;restore a5 from parm. block
  105.         jsr        reqproc                ;call interrupt handler
  106.         movem.l    (sp)+,saveregs        ;restore registers
  107.         rts
  108.         endproc
  109.  
  110. nminstall    proc                    
  111.         move.l    4(sp),a0            ; get pointer parameter
  112.         dc.w    $a05e                ; call NMInstall trap
  113.         rts                            ; return        
  114.         endproc
  115.  
  116. nmremove    proc                    
  117.         move.l    4(sp),a0            ; get pointer parameter
  118.         dc.w    $a05f                ; call NMRemove trap
  119.         rts                            ; return        
  120.         endproc
  121.  
  122. Gestalt    proc
  123.         move.l    4(sp),d0            ; get selector code
  124.         dc.w    $a1ad                ; call Gestalt trap
  125.         move.l    8(sp),a1            ; get response address
  126.         move.l    a0,(a1)                ; copy result back
  127.         rts                            ; return
  128.         endproc
  129.  
  130. PPCInit proc
  131.         moveq    #0,d0                ; Init selector is 0
  132.         dc.w    $a0dd                ; call PPC trap
  133.         rts                            ; return
  134.         endproc
  135.  
  136. ppcsync proc
  137.         move.l    4(sp),d0            ; get selector code
  138.         move.l    8(sp),a0            ; get pb pointer
  139.         dc.w    $a0dd                ; call PPC trap
  140.         rts                            ; return
  141.         endproc
  142.         
  143. ppcasync proc
  144.         move.l    4(sp),d0            ; get selector code
  145.         move.l    8(sp),a0            ; get pb pointer
  146.         dc.w    $a4dd                ; call PPC trap
  147.         rts                            ; return
  148.         endproc
  149.  
  150. PPCBROWSER proc
  151.         link    a6,#0
  152.         subq.l    #2,sp
  153.         move.l    30(a6),-(sp)
  154.         move.l    26(a6),-(sp)
  155.         move.b    24(a6),-(sp)
  156.         move.l    20(a6),-(sp)
  157.         move.l    16(a6),-(sp)
  158.         move.l    12(a6),-(sp)
  159.         move.l    8(a6),-(sp)
  160.         move.w    #$0d00,d0            ; selector
  161.         dc.w    $a82b                ; Pack9
  162.         move.w    (sp)+,d0
  163.         move.w    d0,34(a6)
  164.         unlk    a6
  165.         movea.l    (sp)+,a0
  166.         add.w    #26,sp
  167.         jmp        (a0)
  168.         endproc
  169.         
  170.         end
  171.